@extends('admin.layout.layout')
@section('content')
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">分类添加</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                    @if (count($errors) > 0)
                
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
                <form action="{{url('/admin/cate/insert')}}" method="post">
                    <div class="form-group">
                        <label>选择分类</label>
                        <select name="pid" class="form-control">
                            <option value="0">顶级分类</option>
                            @foreach($cates as $k=>$v)
                            <option value="{{$v->id}}">{{$v->name}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="form-group">
                        <label>分类名</label>
                        <input class="form-control" type="text" name="name" value="{{old('password')}}">
                    </div>
                    
                        {{csrf_field()}}
                    <button type="submit" class="btn btn-primary btn-lg" style="margin-left:90px;width:100px">添加</button>
                    <button type="reset" class="btn btn-primary btn-lg" style="margin-left:100px;width:100px">重置</button>
                </form>
                </div>
            </div>
        </div>
   
@endsection